1. Field of the Invention
The present invention relates to anti-aliasing (AA) performed in a computer system. More particularly, the present invention relates to techniques for efficiently performing AA.
2. Background Art
Aliasing is a well-known effect created by the appearance of undesired artifacts of the rendering process of an image frame displayed on a computer display. Edge aliasing is a particular type of aliasing that creates stair steps in an edge that should look smooth. An existing AA technique for alleviating the effects of edge aliasing is multi-sample anti-aliasing (MSAA). MSAA addresses edge aliasing by obtaining multiple samples of pixels used to generate intermediate points between pixels. The samples (or “sub-pixels”) are averaged to determine the displayed pixel color value. The displayed edge in the multi-sampled image has a softened stair step effect.
Other traditional AA techniques include, for example, fast approximate anti-aliasing (FXAA) and morphological anti-aliasing (MLAA). FXAA and MLAA are performed only during post-processing of an AA application (resolve). These techniques locate discontinuities between pixels of an image, identify predefined patterns, and blend colors in the neighborhood of these patterns. Both of these techniques, however, are costly in terms of requiring a significant amount of information during post-processing, which requires larger amounts of memory bandwidth and compromises speed and quality.
In contrast to MSAA, FXAA and MLAA are incapable of determining the edge topology beneath a pixel. MSAA, on the other hand, includes this information. FXAA and MLAA, therefore, sacrifice quality by unnecessarily blurring the image. Consequently, performance is compromised by having to search through more pixels to discover an edge from which a coverage percentage can be extracted.
By way of background, computers (which include a large variety of form factors and devices such as, for example, laptops, netbooks, servers, televisions, handheld devices like smartphones and the like) are used in many applications. As computing systems continue to evolve, the graphical display requirements of the systems become more demanding. This is especially true in the area of three-dimensional (3D) graphics processing. In order to process 3D graphics images, the position of graphics primitives with respect to the display must be understood in all three dimensions. This includes the dimension of depth, often referred to as the Z dimension. The Z dimension describes the positioning of a video graphics primitive with respect to other video graphics primitives within the display frame in terms of the depth, or distance from the viewer, of the video graphics primitives.
Computer displays and other high resolution display devices such as high definition televisions (HDTVs), projectors, printers, and the like, present an image to the viewer as an array of individual picture elements, or pixels. The individual pixels are given a specific color, which corresponds to the color of the image at the location of the particular pixel. The pixels are closely spaced, and the viewer's visual system performs a filtering of individual pixel colors to form a composite image. If the partitioning of the image into individual pixel elements is performed properly, and the pixels are close enough together, the viewer perceives the displayed array of pixels as a virtually continuous image.
In many systems, graphical images for display are sampled, and the image is reconstructed based on the stored samples. When conservation of the detail is important, over-sampling, a type of AA also known as super-sampling, is typically used to avoid aliasing in the reconstructed graphical image. Over-sampling techniques are well known in the art. In an over-sampling system, multiple samples of each screen element, or pixel, are stored. Although each pixel is rendered using only a single color value, each of the samples for that particular pixel are used in generating the final color. In effect, a much more detailed, or higher-resolution, version of the image is stored within the computer, and this version is used to generate each of the colors for the pixels displayed on the screen.
To present a smooth and continuous image on the display, the entity processing the video graphics images must maintain a high rate of pixel processing. In order to achieve high rates of pixel processing, pixel data stored in memory must be retrieved, processed, and then stored back in the memory in an efficient manner. Pixel fragments that are received generally include multiple samples for a pixel where each sample includes a “Z” value and a color value. The memory bandwidth required to fetch the stored sample data and then rewrite the result of any blending operations that combine the fragment with the current pixel state can be substantial.
MSAA, for example, is memory intensive—requiring extra memory bandwidth and rendering time for each extra fragment internal to a pixel. Other traditional techniques create choke points within the graphics pipeline. For example, FXAA and MLAA assume there is only one color per pixel and perform a significant amount of post processing time based upon the one color per pixel assumption. FXAA and MLAA also consume additional processing time attempting to recover lost information internal to the pixel by searching around neighboring pixels. Although each of these techniques can be adjusted, depending on speed and quality requirements, making minor adjustments to the entire graphics pixel pipeline to optimize quality is inefficient.